package app.Disthanitian.thaistyle.EmerMez;

import android.annotation.SuppressLint;
import android.app.ActionBar;
import android.app.ActionBar.OnNavigationListener;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Toast;

@SuppressLint("NewApi")
public class DropNavigation {
	/** An array of strings to populate dropdown list */
	String[] actions = new String[] { "Bookmark", "Subscribe", "Share" };

	/** Called when the activity is first created. */
	public void onCreate(Bundle savedInstanceState) {
		// super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		/** Create an array adapter to populate dropdownlist */
		ArrayAdapter<String> adapter = new ArrayAdapter<String>(
				getBaseContext(),
				android.R.layout.simple_spinner_dropdown_item, actions);

		/** Enabling dropdown list navigation for the action bar */
		getActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

		/** Defining Navigation listener */
		ActionBar.OnNavigationListener navigationListener = new OnNavigationListener() {

			@Override
			public boolean onNavigationItemSelected(int itemPosition,
					long itemId) {
				Toast.makeText(getBaseContext(),
						"You selected : " + actions[itemPosition],
						Toast.LENGTH_SHORT).show();
				return false;
			}
		};

		/**
		 * Setting dropdown items and item navigation listener for the actionbar
		 */
		getActionBar().setListNavigationCallbacks(adapter, navigationListener);
	}

	private ActionBar getActionBar() {
		// TODO Auto-generated method stub
		return null;
	}

	private Context getBaseContext() {
		// TODO Auto-generated method stub
		return null;
	}

	private void setContentView(int activityMain) {
		// TODO Auto-generated method stub

	}
}
